package vsvm.math;

import java.util.ArrayList;
import java.util.Iterator;

public class CoreMath {

	public static double EPS = 1e-8;
	
	public static double getArea(ArrayList <Point> curve) {
		
		double area = 0;
		Iterator <Point> it = curve.iterator();
		
		Point start = it.next();
		while (it.hasNext()) {
			Point end = it.next();
			area += Math.abs(end.x - start.x)*(start.y + end.y)/2;
			start = end;
		}
		
		return area;		
	}
	

}
